package com.han.demo3.after;

/**
 * @ClassName ComputerDemo
 * @Description 描述该类的功能
 * @Author duoduo Han
 * @Date 2024/6/2 15:09
 */
public class ComputerDemo {
    public static void main(String[] args) {
        //声明电脑组件
        Cpu cpu = new IntelCpu();
        HardDisk hardDisk = new XiJieHardDisk();
        Memory memory = new KingstonMemory();
        //创建电脑
        Computer computer = new Computer();
        computer.setCpu(cpu);
        computer.setHardDisk(hardDisk);
        computer.setMemory(memory);
        //运行电脑
        computer.run();
    }
}
